import allure
from apis.admin_api import AdminApi
from loguru import logger


class AdminCase(AdminApi):
    @allure.step('step:case_banner_list')
    def case_banner_list(self, data):
        """banner列表查询"""
        banner_list_response = self.banner_list_api(data['json']['type'])
        res = banner_list_response.json()
        return res

    @allure.step('step:case_banner')
    def case_banner(self, data):
        """新增banner"""
        banner_response = self.banner_api(type=data['json']['type'], pageType=data['json']['pageType'], background=data['json']['background'])
        res = banner_response.json()
        return res

    @allure.step('step:case_banner_id')
    def case_banner_id(self, data):
        """修改banner"""
        banner_id_response = self.banner_id_api(pageType=data['json']['pageType'], type=data['json']['type'], id=data['json']['id'])
        res = banner_id_response.json()
        return res

    @allure.step('step:case_adjustment_order')
    def case_adjustment_order(self, data):
        adjustment_order_response = self.adjustment_order_api(id=data['json']['id'], move=data['json']['move'])
        res = adjustment_order_response.json()
        return res

    @allure.step('step:case_banner_delete')
    def case_banner_delete(self, data):
        banner_delete_response = self.banner_delete_api(id=data['json']['id'])
        res = banner_delete_response.json()
        return res

    @allure.step('step:case_balance_withdraw_list')
    def case_balance_withdraw_list(self, data):
        balance_withdraw_list_response = self.balance_withdraw_list_api(**data['json'])
        res = balance_withdraw_list_response.json()
        return res

    @allure.step('step:case_balance_audit_withdraw_id')
    def case_balance_audit_withdraw_id(self, data):
        balance_audit_withdraw_id_response = self.balance_audit_withdraw_id_api(id=data['json']['id'], auditState=data['json']['auditState'])
        res = balance_audit_withdraw_id_response.json()
        return res

    @allure.step('step:case_bank_show_cardno')
    def case_bank_show_cardno(self, data):
        bank_show_cardno_response = self.bank_show_cardno_api(id=data['json']['id'])
        res = bank_show_cardno_response.json()
        return res

    @allure.step('step:case_balance_withdraw_id')
    def case_balance_withdraw_id(self, data):
        balance_withdraw_id_response = self.balance_withdraw_id_api(id=data['json']['id'])
        res = balance_withdraw_id_response.json()
        return res

    @allure.step('step:case_productAudit_list')
    def case_productAudit_list(self, data):
        productAudit_list_response = self.productAudit_list_api(pageSize=data['json']['pageSize'], pageNumber=data['json']['pageNumber'], name=data['json']['name'], examineStatus=data['json']['examineStatus'])
        res = productAudit_list_response.json()
        return res

    @allure.step('step:case_productAudit_detail')
    def case_productAudit_detail(self, data):
        productAudit_detail_response = self.productAudit_detail_api(id=data['json']['id'])
        res = productAudit_detail_response.json()
        return res

    @allure.step('step:case_productAudit_approved')
    def case_productAudit_approved(self, data):
        productAudit_approved_response = self.productAudit_approved_api(id=data['json']['id'], remark=data['json']['remark'])
        res = productAudit_approved_response.json()
        return res 

    @allure.step('step:case_productAudit_refused')
    def case_productAudit_refused(self, data):
        productAudit_refused_response = self.productAudit_refused_api(id=data['json']['id'], remark=data['json']['remark'])
        res = productAudit_refused_response.json()
        return res

    @allure.step('step:case_productreport_list')
    def case_productreport_list(self, data):
        productAudit_refused_response = self.productreport_list_api(**data['json'])
        res = productAudit_refused_response.json()
        return res

    @allure.step('step:case_productreport_approved')
    def case_productreport_approved(self, data):
        productreport_approved_response = self.productreport_approved_api(**data['json'])
        res = productreport_approved_response.json()
        return res

    @allure.step('step:case_productreport_approved')
    def case_productreport_refused(self, data):
        productreport_approved_response = self.productreport_refused_api(**data['json'])
        res = productreport_approved_response.json()
        return res

    @allure.step('step:case_appversion_page')
    def case_appversion_page(self, data):
        appversion_page_response = self.appversion_page_api(**data['json'])
        res = appversion_page_response.json()
        return res

    @allure.step('step:case_appversion_list_api')
    def case_appversion_list(self, data):
        appversion_list_response = self.appversion_list_api(**data['json'])
        res = appversion_list_response.json()
        return res

    @allure.step('step:case_appversion_add')
    def case_appversion_add(self, data):
        appversion_add_response = self.appversion_add_api(**data['json'])
        res = appversion_add_response.json()
        return res

    @allure.step('step:case_appversion_detail')
    def case_appversion_detail(self, data):
        appversion_detail_response = self.appversion_detail_api(**data['json'])
        res = appversion_detail_response.json()
        return res

    @allure.step('step:case_userrate_list')
    def case_userrate_list(self, data):
        userrate_list_response = self.userrate_list_api(**data['json'])
        res = userrate_list_response.json()
        return res

    @allure.step('step:case_userrate_detail')
    def case_userrate_detail(self, data):
        userrate_detail_response = self.userrate_detail_api(**data['json'])
        res = userrate_detail_response.json()
        return res

    @allure.step('step:case_userrate_add')
    def case_userrate_add(self, data):
        userrate_add_response = self.userrate_add_api(**data['json'])
        res = userrate_add_response.json()
        return res

    @allure.step('step:case_userrate_update')
    def case_userrate_update(self, data):
        userrate_update_response = self.userrate_update_api(**data['json'])
        res = userrate_update_response.json()
        return res

    @allure.step('step:case_queryInvitation')
    def case_queryInvitation(self, data):
        queryInvitation_response = self.queryInvitation_api(**data['json'])
        res = queryInvitation_response.json()
        return res

    @allure.step('step:case_queryInvitationItem')
    def case_queryInvitationItem(self, data):
        queryInvitationItem_response = self.queryInvitationItem_api(**data['json'])
        res = queryInvitationItem_response.json()
        return res

    @allure.step('step:case_exportExcel')
    def case_exportExcel(self):
        exportExcel_response = self.exportExcel_api()
        res = exportExcel_response.status_code
        return res

    @allure.step('step:case_exportItemExcel')
    def case_exportItemExcel(self):
        exportItemExcel_response = self.exportItemExcel_api()
        res = exportItemExcel_response.status_code
        return res
    
    @allure.step('step:case_exportItemExcel')
    def case_userStatistics(self):
        userStatistics_response = self.userStatistics_api()
        res = userStatistics_response.status_code
        return res

    @allure.step('step:case_qlf_shop')
    def case_qlf_shop(self, data):
        qlf_shop_response = self.qlf_shop_api(**data['json'])
        res = qlf_shop_response.json()
        return res

    @allure.step('step:case_qlf_shop_list')
    def case_qlf_shop_list(self):
        qlf_shop_list_response = self.qlf_shop_list_api()
        res = qlf_shop_list_response.json()
        return res

    @allure.step('step:case_qlf_shop_id')
    def case_qlf_shop_id(self, data):
        qlf_shop_id_response = self.qlf_shop_id_api(**data['json'])
        res = qlf_shop_id_response.json()
        return res

    @allure.step('step:case_qlf_shop_status')
    def case_qlf_shop_status(self, data):
        qlf_shop_status_response = self.qlf_shop_status_api(**data['json'])
        res = qlf_shop_status_response.json()
        return res
    
    @allure.step('step:case_qlf_shop_id_info')
    def case_qlf_shop_id_info(self, data):
        qlf_shop_id_info_response = self.qlf_shop_id_info_api(**data['json'])
        res = qlf_shop_id_info_response.json()
        return res

    @allure.step('step:case_qlf_shop_productlist')
    def case_qlf_shop_productlist(self, data):
        qlf_shop_productlist_response = self.qlf_shop_productlist_api(**data['json'])
        res = qlf_shop_productlist_response.json()
        return res

    @allure.step('step:case_qlf_shop_productid')
    def case_qlf_shop_productid(self, data):
        qlf_shop_productid_response = self.qlf_shop_productid_api(**data['json'])
        res = qlf_shop_productid_response.json()
        return res

    @allure.step('step:case_qlf_shop_category')
    def case_qlf_shop_category(self, data):
        qlf_shop_category_response = self.qlf_shop_category_api(**data['json'])
        res = qlf_shop_category_response.json()
        return res

    @allure.step('step:case_qlf_shop_categorylist')
    def case_qlf_shop_categorylist(self, data):
        qlf_shop_categorylist_response = self.qlf_shop_categorylist_api(**data['json'])
        res = qlf_shop_categorylist_response.json()
        return res

    @allure.step('step:case_qlf_shop_categoryDelete_api')
    def case_qlf_shop_categoryDelete(self, data):
        qlf_shop_categoryDelete_response = self.qlf_shop_categoryDelete_api(**data['json'])
        res = qlf_shop_categoryDelete_response.json()
        return res

    @allure.step('step:case_qlf_shop_product_template')
    def case_qlf_shop_product_template(self, data):
        qlf_shop_product_template_response = self.qlf_shop_product_template_api(**data['json'])
        res = qlf_shop_product_template_response.json()
        return res

    @allure.step('step:case_qlf_shop_product')
    def case_qlf_shop_product(self, data):
        qlf_shop_product_response = self.qlf_shop_product_api(**data['json'])
        res = qlf_shop_product_response.json()
        return res

    @allure.step('step:case_qlf_shop_category_id')
    def case_qlf_shop_category_id(self, data):
        qlf_shop_category_id_response = self.qlf_shop_category_id_api(**data['json'])
        res = qlf_shop_category_id_response.json()
        return res

    @allure.step('step:case_qlf_shop_ref_export')
    def case_qlf_shop_ref_export(self, data):
        qlf_shop_ref_export_response = self.qlf_shop_ref_export_api(**data['json'])
        res = qlf_shop_ref_export_response.status_code
        return res

    @allure.step('step:case_product_find_indexconfig')
    def case_product_find_indexconfig(self, data):
        product_find_indexconfig_response = self.product_find_indexconfig_api(**data['json'])
        res = product_find_indexconfig_response.json()
        return res

    @allure.step('step:case_category_query')
    def case_category_query(self):
        category_query_response = self.category_query_api()
        res = category_query_response.json()
        return res

    @allure.step('step:case_category_updateCategory')
    def case_category_updateCategory(self, data):
        category_updateCategory_response = self.category_updateCategory_api(**data['json'])
        res = category_updateCategory_response.json()
        return res

    @allure.step('step:case_constantConfig_constantList')
    def case_constantConfig_constantList(self):
        constantConfig_constantList_response = self.constantConfig_constantList_api()
        res = constantConfig_constantList_response.json()
        return res

    @allure.step('step:case_constantConfig_updateConstantConfig')
    def case_constantConfig_updateConstantConfig(self, data):
        constantConfig_updateConstantConfig_response = self.constantConfig_updateConstantConfig_api(**data['json'])
        res = constantConfig_updateConstantConfig_response.json()
        return res

    @allure.step('step:case_guide_list')
    def case_guide_list(self):
        guide_list_response = self.guide_list_api()
        res = guide_list_response.json()
        return res